/*
 * @Author: 可以清心
 * @Description: 
 * @Date: 2022-11-28 09:14:26
 * @LastEditTime: 2023-01-28 20:16:11
 */
export default {
    setStorage: function(passOrname, type){
        let key = btoa(type);
        let value = btoa(passOrname);
        localStorage.setItem(key, value);
    },
    getPassWord: function(){
        let key = btoa('password');
        
        return localStorage.getItem(key);
    },
    getUsername: function(){
        let key = btoa('username');

        return localStorage.getItem(key);
    },
    removeStorage: function(){
        localStorage.removeItem(btoa('username'));
        localStorage.removeItem(btoa('password'));
    },
    setModule: function(data){
        let result = {
            adminModule: {},
            authModule: {},
            fontModule: {}
        }

        result.authModule = {
            token: data.token,
            userInfo: {
                // ...data.user,
                ...data.userInfo,
                tenant: data.userDefaultTenant,
                // department: data.userDepartment
            }
        }

        localStorage.setItem(`__vuex__workbench__local`, JSON.stringify(result));
        // console.log(data);
    }
}